package com.github.cooingandwooing.service.impl;

import com.baomidou.dynamic.datasource.annotation.DS;
import com.github.cooingandwooing.manager.AccountManager;
import com.github.cooingandwooing.service.AtAccountService;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.beans.factory.annotation.Autowired;

import java.math.BigDecimal;

/**
 * @author cooingandwooing
 */
@DubboService(version = "1.0.0",group = "learn-design-server")
public class AtAccountServiceImpl implements AtAccountService {

    @Autowired
    private AccountManager accountManager;

    @Override
    @DS("master")
    public boolean deductAccountBalance(Long userId, BigDecimal amount,Long accountId) {
        return accountManager.deductAccountBalance(userId,amount,accountId);
    }
}
